package cn.tedu.ai.controller;


import cn.tedu.ai.config.AiChatConfig;
import cn.tedu.ai.service.AiChatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.CompletableFuture;

@RestController
@RequestMapping("/us/you/ai")
@Api(tags = "大模型")
@Slf4j
public class AIChatController  {

    @Autowired
    private AiChatService aiChatService;

    @PostMapping("/chat")
    @ApiOperation("大模型实时聊天")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "text", value = "达内，你好")
    })
    public String chat(String text) throws Exception {
        return aiChatService.chat(text);
    }
}
